﻿using System;

namespace MqResearchCSharp.ActiveMq.ActiveMQ
{
    [Serializable]
    public class TaskMessage
    {
        /// <summary>
        /// 任务ID
        /// </summary>
        public string TaskID { get; set; }
        /// <summary>
        /// 任务名称名称,如"GradientBoostingRegressor"
        /// </summary>
        public string TaskName { get; set; }
        /// <summary>
        ///  任务所需的入口参数
        /// </summary>
        public string TaskParam { get; set; }
        /// <summary>
        /// 任务计算的结果
        /// </summary>
        public string TaskResult { get; set; }
        /// <summary>
        /// 任务计算过程中的错误
        /// </summary>
        public string Error { get; set; }
        /// <summary>
        /// 任务计算耗时（毫秒）
        /// </summary>
        public double TotalSeconds { get; set; }
        /// <summary>
        /// 任务超时时间（毫秒）,默认10秒
        /// </summary>
        public int TimeOut { get; set; } = 10 * 1000;
        public TaskMessage(string taskName)
        {
            TaskID = Guid.NewGuid().ToString();
            TaskName = taskName;
        }
    }
}
